# -*- coding: utf-8 -*-
'''
@author: Hugo
@file: demo.py
@time: 2021/8/11 22:00
'''
from mitmproxy import http


def request(flow:http.HTTPFlow):
    print(fr'$$$$$${flow.request.headers}')
    flow.request.headers['User-Agent'] = 'feifei'
    flow.request.query['ffff'] = 'huge'
#
def response(flow):
    flow.response.headers['name'] = 'feibao'
    response = flow.response
    for k,v in response.headers.items():
        print(fr'%%%%{k}:{v}')